<template>
	<view class="main">
		<!--list type1 start-->	
		<block v-if="listRow.length>0">
		<view class="inter-item" v-for="(item,index) in listRow" :key="index">
			<view class="item-block v-box dis-clm">
				<view class="block-title dis-row poser" @click="NavOrderinfo(item)">
					<label v-if="item.type==1">置顶</label>
					<text v-if="item.type == 0">{{cutstr(item.title,65)}}</text>
					<view v-if="item.type == 1">{{cutstr(item.title,65)}}</view>
				</view>
				<view class="block-pre" @click="NavOrderinfo(item)" v-if="item.workDesc">{{cutstr(item.workDesc,103)}}</view>
				<view class="bloc-small" @click="NavOrderinfo(item)">
					<label class="noactive" v-if="item.salaryStr">{{item.salaryStr}}</label>
					<label v-if="item.settlementStr">{{item.settlementStr}}</label>
				<!-- 	<label>包吃包住</label>
					<label>高温补贴</label>
					<label>医疗保险</label> -->
					 <block v-if="item.welfareNew"><label v-for="(childitem,childindex) in item.welfareNew">{{childitem}}</label></block>
				</view>
				<!--个人认证开始-->
				<view class="bloc-filename poser" v-if="item.isEnterprice!=1 && item.isRealName ==1">
					<view class="file-left dis-clm" >
						<view class="left-t1 dis-row">
							<view class="leftchild-v1" v-if="item.nickName">{{item.nickName}}</view>
					<!-- 		<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/user-real.svg" /></label>
							<text>实名认证</text> -->
							<block v-if="item.isEnterPrise == 0 && item.isRealName == 1">
							  <image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/user-real.svg" />
							  <text>实名认证</text>
							</block>
						</view>
						<view class="button-v1 dis-row">
							<view class="map-ico"><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/ico-address.svg"></image></view>
							<view class="bt-s dis-row">
								<label>{{item.cityArea}}</label><text>·</text><label>{{item.createTime}}</label>
							</view>
						</view>
					</view>
					
					<view class="rev-av dis-clm" v-if="item.status == 0">
							<!-- <view class="botton-sv1">
								<label class="labelbg2">接通率高</label>
							</view> -->
							<view class="botton-sv2" @click="NavOrderinfo(item)">立即联系</view>
						</view>
						<view class="rev-av dis-clm" v-if="item.status == 9">
					<!-- 		<view class="botton-sv1">
								<label class="labelbg2">接通率高</label>
							</view> -->
							<view class="botton-sv2 disbael">已下线</view>
						</view>
				</view>
				<!--个人认证结束-->
				<!--个人认证开始-->
				<view class="bloc-filename poser" v-if="item.nickName!='' && item.isRealName ==0">
					<view class="file-left dis-clm" >
						<view class="left-t1 dis-row">
							<view class="leftchild-v1" v-if="item.nickName">{{item.nickName}}</view>
					<!-- 		<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/user-real.svg" /></label>
							<text>实名认证</text> -->
							<block v-if="item.isEnterPrise == 0 && item.isRealName == 1">
							  <image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/user-real.svg" />
							  <text>实名认证</text>
							</block>
						</view>
						<view class="button-v1 dis-row">
							<view class="map-ico"><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/ico-address.svg"></image></view>
							<view class="bt-s dis-row">
								<label>{{item.cityArea}}</label><text>·</text><label>{{item.createTime}}</label>
							</view>
						</view>
					</view>
					
					<view class="rev-av dis-clm" v-if="item.status == 0">
							<!-- <view class="botton-sv1">
								<label class="labelbg2">接通率高</label>
							</view> -->
							<view class="botton-sv2" @click="NavOrderinfo(item)">立即联系</view>
						</view>
						<view class="rev-av dis-clm" v-if="item.status == 9">
					<!-- 		<view class="botton-sv1">
								<label class="labelbg2">接通率高</label>
							</view> -->
							<view class="botton-sv2 disbael">已下线</view>
						</view>
				</view>
				<!--个人认证结束-->
				<!--企业认证开始-->
				<view class="bloc-filename  poser" v-if="item.isRealName!=1 && item.isEnterprice ==1">
					<view class="file-left dis-clm">
						<view class="left-t1 dis-row">
							<view class="leftchild-v1" v-if="item.enterPriseName">{{item.enterPriseName}}</view>
							<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/comp-real.svg" /></label>
							<text style="color: #D9A14E;">企业认证</text>
						</view>
						<view class="button-v1 dis-row">
							<view class="map-ico"><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/ico-address.svg"></image></view>
							<view class="bt-s dis-row">
								<label>{{item.cityArea}}</label><text>·</text><label>{{item.createTime}}</label>
							</view>
						</view>
					</view>
					<view class="rev-av dis-clm" v-if="item.status == 0">
						<!-- <view class="botton-sv1">
							<label class="labelbg2">接通率高</label>
						</view> -->
						<view class="botton-sv2" @click="NavOrderinfo(item)">立即联系</view>
					</view>
					<view class="rev-av dis-clm" v-if="item.status == 9">
				<!-- 		<view class="botton-sv1">
							<label class="labelbg2">接通率高</label>
						</view> -->
						<view class="botton-sv2 disbael">已下线</view>
					</view>
				</view>
				<!--企业认证结束-->
				<!--企业认证开始-->
				<view class="bloc-filename  poser" v-if="item.isRealName==1 && item.isEnterprice ==1">
					<view class="file-left dis-clm">
						<view class="left-t1 dis-row">
							<view class="leftchild-v1" v-if="item.enterPriseName">{{item.enterPriseName}}</view>
							<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/comp-real.svg" /></label>
							<text style="color: #D9A14E;">企业认证</text>
						</view>
						<view class="button-v1 dis-row">
							<view class="map-ico"><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/ico-address.svg"></image></view>
							<view class="bt-s dis-row">
								<label>{{item.cityArea}}</label><text>·</text><label>{{item.createTime}}</label>
							</view>
						</view>
					</view>
					<view class="rev-av dis-clm" v-if="item.status == 0">
						<!-- <view class="botton-sv1">
							<label class="labelbg2">接通率高</label>
						</view> -->
						<view class="botton-sv2" @click="NavOrderinfo(item)">立即联系</view>
					</view>
					<view class="rev-av dis-clm" v-if="item.status == 9">
				<!-- 		<view class="botton-sv1">
							<label class="labelbg2">接通率高</label>
						</view> -->
						<view class="botton-sv2 disbael">已下线</view>
					</view>
				</view>
				<!--企业认证结束-->
			</view>
		</view>
		</block>
			<block v-if="listRow.length == 0">
				<view class="empty-img">
					<image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/icon50.png"></image>
					<label>暂无内容</label>
				</view>
			</block>
	    <!--list type1 over-->	
		<!--list type1 start-->
		<!-- <view class="inter-item">
			<view class="item-block v-box dis-clm sbtnbg">
				<view class="block-title dis-row poser"><label>置顶</label><view>陕西西安未央区招木工、未央区招木未央区招木未央区招木水电工</view></view>
				<view class="block-pre">轻轻松松月入过万，现有33层招钢筋大工，二把刀不要！！</view>
				<view class="bloc-small">
					<label class="noactive">350元/天</label>
					<label>日结</label>
					<label>包吃包住</label>
					<label>高温补贴</label>
					<label>医疗保险</label>
				</view>
				<view class="bloc-filename  poser">
					<view class="file-left dis-clm">
						<view class="left-t1 dis-row">
							<view class="leftchild-v1">中国建筑有限公司</view>
							<label><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/comp-real.svg" /></label>
							<text style="color: #D9A14E;">企业认证</text>
						</view>
						<view class="button-v1 dis-row">
							<view class="map-ico"><image src="http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/my/ico-address.svg"></image></view>
							<view class="bt-s dis-row">
								<label>陕西西安</label><text>·</text><label>01-20 19:00:00</label>
							</view>
						</view>
					</view>
					<view class="rev-av dis-clm">
						<view class="botton-sv1">
							<label class="labelbg1">接通率高</label>
							<label class="labelbg2">接通率高</label>
						</view>
						<view class="botton-sv2">立即联系</view>
					</view>
				</view>
			</view>
		</view> -->
		<!--list type1 over-->	
		
		
		
		<view style="height: 80rpx;"></view>
	</view>
</template>

<script>
import Index from "@/common/index-model.js"	
let index = new Index()
let that = null
export default {
	data() {
		return {
		  	listRow:[],
		}
	},
	onLoad() {
		this.getListRow()
	},
	methods: {
	   getListRow() {
		   let send={"time":this.timestampToTime()}
		   let url="client/individual/collect?time="+this.timestampToTime()
		  index.getPublicUserMember(send,'client/individual/collect','post',res=>{
			  let arr=[],welfares=[]
			  this.listRow =[]
			  if(res.data.code == 200 && res.data.success){
				  arr = res.data.result
				  if(arr.length>0){
					  for(let i=0;i<arr.length;i++){
					  //	arr[i].titleName = arr[i].address+'招'+arr[i].skills  //拼接地址+技能 = 列表标题
					  	if(arr[i].welfare){
					  		welfares=arr[i].welfare.split(',');
					  		for(let i=0;i<welfares.length;i++){
					  			if(welfares[i] == ''){
					  				welfares.splice(i,1)
					  			}
					  		}
					  		arr[i].welfareNew = welfares;
					  		//arr[i].welfareNew = arr[i].welfare.split(',')
					  	}else{
					  		arr[i].welfareNew = []
					  	}
					  	this.listRow.push(arr[i])
					  }
				  }
			  }else{
				  this.listRow =[]
			  }
		  }) 
	   },
	   timestampToTime() {
	   		var date = new Date();//时间戳为10位需*1000，时间戳为13位的话不需乘1000
	   		var Y = date.getFullYear()+'-';
	   		var M = (date.getMonth()+1<10?'0'+(date.getMonth()+1):date.getMonth()+1)+'-';
	   		var D = date.getDate()<10?('0'+date.getDate()+' '):(date.getDate()+' ');
	   		var h = date.getHours()<10?('0'+date.getHours()+':'):(date.getHours()+':');
			var m = date.getMinutes()<10?('0'+date.getMinutes()+':'):(date.getMinutes()+':');
			var s = date.getSeconds()<10?('0'+date.getSeconds()):(date.getSeconds());
	   		// var m = date.getMinutes() + ':';
	   		// var s = date.getSeconds();
	   	    return Y+M+D+h+m+s;
	   },
	   cutstr(str, len) {
	   	var str_length = 0;
	   	var str_len = 0;
	   	var str_cut = new String();
	   	str_len = str.length;
	   	for (var i = 0; i < str_len; i++) {
	   		var a = str.charAt(i);
	   		str_length++;
	   		if (escape(a).length > 4) {
	   			//中文字符的长度经编码之后大于4  
	   			str_length++;
	   		}
	   		str_cut = str_cut.concat(a);
	   		if (str_length >= len) {
	   			str_cut = str_cut.concat("...");
	   			return str_cut;
	   		}
	   	}
	   	//如果给定字符串小于指定长度，则返回源字符串；  
	   	if (str_length < len) {
	   		return str;
	   	}
	   },
	   NavOrderinfo(item) {
		   if(item.orderId){
			   let url="../../pagesB/jobinfo/index?id="+item.orderId
			   index.navigate_to(url)
		   }else{
			   index.show_tips('缺少项目id')
			   return false
		   }
	   }
	}
}
</script>

<style>
@import url("@/static/css/publics.css");
@import url("@/static/css/myBeInterested.css");	
</style>